/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.skatiger.jrove.impl.jaxb;

import java.lang.reflect.Method;
import java.net.URL;

import org.skatiger.jrove.TagHandler;
import org.skatiger.jrove.tag.AbstractTagLibrary;
import org.skatiger.jrove.util.AssertUtil;

class TagLibraryImpl extends AbstractTagLibrary {
    public TagLibraryImpl(String namespace) {
        super(namespace);
    }

    public void putComponent(String name,
            String componentClass,
            String rendererType) {
        AssertUtil.notNull(name);
        AssertUtil.notNull(componentClass);
        this.addComponent(name, componentClass, rendererType);
    }

    public void putComponent(String name,
            String componentClass,
            String rendererType,
            Class<? extends TagHandler> handlerClass) {
        AssertUtil.notNull(name);
        AssertUtil.notNull(componentClass);
        AssertUtil.notNull(handlerClass);
        this.addComponent(name, componentClass, rendererType, handlerClass);
    }

    public void putFunction(String name, Method method) {
        AssertUtil.notNull(name);
        AssertUtil.notNull(method);
        this.addFunction(name, method);
    }

    public void putTagHandler(String name, Class<? extends TagHandler> type) {
        AssertUtil.notNull(name);
        AssertUtil.notNull(type);
        this.addTagHandler(name, type);
    }

    public void putUserTag(String name, URL source) {
        AssertUtil.notNull(name);
        AssertUtil.notNull(source);
        this.addUserTag(name, source);
    }

}
